* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: white;
  color: #111;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header,
menu {
  flex-shrink: 0;
}

header {
  background: white;
  color: #e7853f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

header nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
}

menu {
  background: #e7853f;
  color: white;
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 20px;
  width: 100%;
  gap: 0;
  overflow: visible;
}

table {
  border-collapse: collapse;
  margin: 10px auto;
  width: 95%;
}

th {
  background-color: #e7853f;
  color: white;
  padding: 10px;
}

td {
  padding: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

td .btn {
  display: inline-block;
  margin: 2px;
  font-size: 0.9em;
}

table,
th,
td {
  border: 1px solid #e7853f;
}

.logo {
  font-weight: bold;
}

.btn {
  background: white;
  color: #111;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}

.btn.grande {
  margin-top: 20px;
  display: inline-block;
}

.hero {
  text-align: center;
  padding: 80px 20px;
  flex: 1;
  overflow-y: auto;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.hero p {
  font-size: 18px;
  margin-bottom: 25px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 40px;
}

.card {
  background: white;
  padding: 30px;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

footer {
  background: #e7853f;
  color: white;
  text-align: right;
  padding: 20px;
  margin-top: auto;
  flex-shrink: 0;
}

footer a {
  display: inline-block;
  width: fit-content;
  height: fit-content;
  pointer-events: auto;
}

.password {
  width: 100%;
  padding: 10px;
  padding-right: 40px;
}

.menu {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.menu-scroll-wrapper {
  flex: 1;
  min-width: 0;               /* ← CLAVE: sin esto flex ignora el overflow */
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 20px;
}

.menu-scroll-wrapper::-webkit-scrollbar {
  display: none;            /* Chrome/Safari */
}

.menu-btn-desktop {
  flex-shrink: 0;             /* ← no se comprime nunca */
  display: block;
  padding-left: 12px;
}

.menu li {
  position: relative;
}

.menu a {
  color: white;
  text-decoration: none;
  padding: 15px 5px;
  display: block;
  font-weight: 500;
}

.dropdown {
  display: none;
  position: fixed;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  z-index: 999;
}

.submenu:hover .dropdown {
  display: block;
}

.dropdown li a {
  padding: 12px 16px;
  color: black;
}

.dropdown li a:hover {
  background: rgba(255, 255, 255, 0.15);
}

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.volver {
  color: #e2af74;
  text-decoration: none;
  font-size: 14px;
}

.volver:hover {
  color: #444;
}

.redes {
  pointer-events: auto;
}

.redes a {
  display: inline-flex;
  padding: 0;
  margin: 0;
  line-height: 0;
  pointer-events: auto;
}

.redes a img {
  height: 25px;
  display: block;
}

.imagen-inicio {
  width: 100%;
  height: calc(100vh - 200px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.tarjetas-container {
  display: block;
  margin: 0 auto;
  padding: 40px;
  width: 100%;
}

.tarjeta {
  background: white;
  border: 2px solid #e7853f;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s;
  cursor: pointer;
  margin-bottom: 20px;
  width: 30%;
  float: left;
}

.tarjeta:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(231, 133, 63, 0.3);
}

.tarjeta img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.tarjeta-contenido {
  padding: 15px;
}

.tarjeta-titulo {
  color: #e7853f;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
}

.tarjeta-fecha {
  color: #777;
  font-size: 0.9em;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 30px;
  text-align: center;
}

.carousel-caption h2 {
  margin: 0 0 10px 0;
  font-size: 2em;
}

.categoria-badge {
  background: #e7853f;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9em;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(231, 133, 63, 0.8);
  color: white;
  border: none;
  font-size: 2em;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(231, 133, 63, 1);
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: white;
}

.eventos-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
}

.evento {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 2px solid #e7853f;
  cursor: pointer;
  transition: background 0.2s;
}

.evento:hover {
  background: #fff5f0;
}

.fecha-box {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: #e7853f;
  color: white;
  text-align: center;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-weight: bold;
}

.fecha-dia {
  font-size: 2em;
  line-height: 1;
}

.fecha-mes {
  font-size: 0.9em;
  text-transform: uppercase;
}

.evento-info {
  flex: 1;
}

.evento-titulo {
  color: #e7853f;
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 5px;
}

.evento-fecha-completa {
  color: #777;
  margin-bottom: 10px;
}

.evento-preview {
  color: #333;
  line-height: 1.6;
}

.seccion-titulo {
  color: #e7853f;
  font-size: 1.5em;
  margin: 30px 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 3px solid #e7853f;
}

/* ========== DISEÑO RESPONSIVE ========== */

/* Esconder botón hamburguesa en escritorio */
.menu-toggle {
  display: none;
}

.menu-btn-mobile {
  display: none;
}

.menu-btn-desktop {
  display: block;
}

/* Tablets y móviles grandes (menor a 1024px) */
@media (max-width: 1024px) {
  .tarjetas-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Móviles (menor a 768px) */
@media (max-width: 768px) {

  /* Header: logos y texto en vertical */
  header {
    flex-direction: row;
    /* Cambiar de column a row */
    padding: 10px 5px;
    justify-content: space-between;
    align-items: center;
  }

  header .logo {
    height: 50px !important;
    margin: 0;
    flex-shrink: 0;
  }

  header h1 {
    font-size: 1em !important;
    line-height: 1.2;
    margin: 0;
  }

  header p {
    font-size: 0.8em !important;
    line-height: 1.1;
    margin: 0;
  }

  header nav {
    flex: 1;
    padding: 0 5px;
    text-align: center;
  }

  /* MENÚ HAMBURGUESA */
  menu {
    position: relative;
    padding: 0 20px;
  }

  .menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 5px;
  }

  .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: #e7853f;
    z-index: 1000;
    gap: 0;
  }

  .menu.active {
    display: flex;
  }

  .menu li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .menu li a {
    display: block;
    padding: 15px;
    font-size: 0.95em;
  }

  /* Botones acceder/cerrar sesión */
  .menu-btn-desktop {
    display: none;
  }

  .menu-btn-mobile {
    display: block;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
  }

  .menu-btn-mobile a {
    color: white;
    font-weight: bold;
    display: block;
    padding: 15px;
  }

  .evento {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #e7853f;
    cursor: pointer;
    transition: background 0.2s;
    align-items: center !important;
    justify-content: center !important;
  }

  .eventos-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
  }

  .evento-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center !important;
    text-align: center !important;
  }

  .evento-titulo,
  .evento-fecha-completa,
  .evento-preview {
    width: 100%;
    text-align: center !important;
  }

  /* Tarjetas en 1 sola columna */
  .tarjetas-container {
    grid-template-columns: 1fr !important;
    column-count: 1 !important;
    padding: 15px;
    display: block !important;
  }

  .tarjeta {
    width: 100% !important;
    margin-bottom: 15px;
    break-inside: auto !important;
    display: block !important;
  }

  /* Tablas: scroll horizontal */
  table {
    display: table !important;
    overflow-x: auto;
    font-size: 0.85em;
    width: 100% !important;
    margin: 10px 0 !important;
  }

  table td,
  table th {
    padding: 8px 4px;
    font-size: 0.85em;
  }

  /* Hacer que la tabla scrollee si es muy ancha */
  .hero {
    overflow-x: auto;
  }

  /* Acerca de: imagen y texto en vertical */
  section.hero[style*="flex"] {
    flex-direction: column !important;
  }

  section.hero[style*="flex"]>div {
    width: 100% !important;
    padding-right: 0 !important;
  }

  /* Formularios */
  .login-form {
    max-width: 90% !important;
  }

  /* Calendario */
  .evento {
    flex-direction: column;
    align-items: flex-start;
  }

  .fecha-box {
    margin-bottom: 10px;
  }

  /* Espaciado general */
  section.hero {
    padding: 15px 10px !important;
  }

  /* Botones de contacto en vertical */
  .hero>div>div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .hero>div>div:last-child .btn {
    width: 100%;
    text-align: center;
    font-size: 0.85em;
    padding: 8px 12px;
  }

  /* Botones de filtro de publicaciones en grid */
  .hero>div[style*="margin-bottom"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
    margin: 20px auto !important;
    width: 95% !important;
  }

  .hero>div[style*="margin-bottom"] .btn {
    margin: 0 !important;
    font-size: 0.85em;
    padding: 8px 12px;
    text-align: center;
  }

  footer {
    padding: 15px;
  }
}

/* Móviles pequeños (menor a 480px) */
@media (max-width: 480px) {
  .carousel-caption h2 {
    font-size: 1em;
  }

  .categoria-badge {
    font-size: 0.75em;
  }

  table {
    font-size: 0.75em;
  }

  /* Botones de contacto en vertical */
  .hero>div>div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .hero>div>div:last-child .btn {
    width: 100%;
    text-align: center;
    font-size: 0.85em;
    padding: 8px 12px;
  }
}